package com.ai.langchain4j.service.impl;

import com.ai.langchain4j.service.ToolsService;
import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Service;

/**
 * @Author: suren@517na.com
 * @CreateTime: 2025-05-27
 * @Description: ToolsService实现类
 */

@Service
public class ToolsServiceImpl implements ToolsService {
    @Override
    @Tool("贵州有多少叫姓名的")
    public Integer guizhouNameCount(@P("姓名") String name) {
        return 10;
    }

    @Override
    @Tool("贵州的天气")
    public String getWeather() {
        return "下雨";
    }

    @Override
    @Tool("航班取消预定")
    public void cancel(@P("预定号") String number, @P("客户姓名") String name) {
        System.out.println("尊敬的" + name + "先生/女士，" + "你的航班" + number + "已经取消！");
    }


}
